module AsciidocBib

  #
  # Simple checks on available styles through CSL
  #
  module Styles

    # Returns a list of available styles.
    def Styles.available
      CSL::Style.ls
    end

    # Retrieves a default style, here set to 'apa'.
    def Styles.default_style
      'apa'
    end

    # Checks if a given style (as input by user) is available in CSL.
    def Styles.valid? style
      Styles.available.include? style
    end

    # Checks if given style is a numeric style, 
    # i.e. one that uses numeric references.
    def Styles.is_numeric? style
      CSL::Style.load(style).citation_format == :numeric
    end
  end
end

